#include<stdio.h>
#include"process.h"
#include<string.h>
#include<unistd.h>

#define NUM 101
#define STYLE '='

void Process()
{
  const char* label = "|/-\\";
  int len = strlen(label);
  char bar[NUM];
  memset(bar, '\0', sizeof(bar));
  int cnt = 0;
  while(cnt <= 100)
  {
    printf("[%-100s][%d%%][%c]\r", bar, cnt, label[cnt%len]);
    fflush(stdout);
    bar[cnt] = STYLE;
    cnt++;
    if(cnt == NUM)
    {
      bar[cnt-1] = '\0';
      printf("[%-100s][%d%%][%c]\r", bar, cnt-1, label[cnt%len]);
      break;
    }
    bar[cnt] = '>';

    usleep(100000);
  }

  printf("\n");
}


